﻿<UserControl x:Class="AppToolkit.WPF.Tests.UI.Converters.EnumToImageResourceConverterUI"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d"
             xmlns:cnv="clr-namespace:AppToolkit.WPF.UI.Converters;assembly=AppToolkit.WPF"
             xmlns:local="clr-namespace:AppToolkit.WPF.Tests.UI.Converters"
             d:DesignHeight="263" d:DesignWidth="348" x:Name="Control">
    <UserControl.Resources>
        <cnv:EnumToBitmapResourceConverter x:Key="theConverter">
            <cnv:EnumToBitmapResourceConverter.Mappings>
                <cnv:MappingCollection>
                <cnv:MappingElement TypeName="Value1" ResourceUri="Images/Image 1.png" />
                <cnv:MappingElement TypeName="Value2" ResourceUri="Images/Image 2.png" />
                <cnv:MappingElement TypeName="Value3" ResourceUri="Images/Image 3.png" />
                </cnv:MappingCollection>
            </cnv:EnumToBitmapResourceConverter.Mappings>
        </cnv:EnumToBitmapResourceConverter>
    </UserControl.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="204*" />
            <ColumnDefinition Width="144*" />
        </Grid.ColumnDefinitions>
        <Border BorderBrush="#FF834A4A" Background="#FFF5CFCF" BorderThickness="2" Margin="3" Padding="3" Grid.Column="1">
        <Image Name="image1" Stretch="Fill" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
               Source="{Binding Path=ImageType.CurrentItem, Converter={StaticResource theConverter}}"
               />
            <!--Source="{Binding Path=ImageType.CurrentItem, Converter={StaticResource theConverter}}"-->
        </Border>
        <ListBox Height="81" HorizontalAlignment="Left" Margin="12,12,0,0" Name="listBox1" VerticalAlignment="Top" Width="186" 
                 ItemsSource="{Binding Path=ImageType}" IsSynchronizedWithCurrentItem="True" />
    </Grid>
</UserControl>
